/**
 */
package js.phonegap.impl;

import js.JsPackage;

import js.backbone.BackbonePackage;

import js.backbone.impl.BackbonePackageImpl;

import js.impl.JsPackageImpl;

import js.phonegap.Accelerometer;
import js.phonegap.Calendar;
import js.phonegap.Camera;
import js.phonegap.Capture;
import js.phonegap.Compass;
import js.phonegap.Connection;
import js.phonegap.Contacts;
import js.phonegap.Device;
import js.phonegap.Events;
import js.phonegap.File;
import js.phonegap.Geolocation;
import js.phonegap.Media;
import js.phonegap.Notification;
import js.phonegap.PhonegapApp;
import js.phonegap.PhonegapFactory;
import js.phonegap.PhonegapPackage;
import js.phonegap.Plugin;
import js.phonegap.Storage;

import js.phonegap.methods.MethodsPackage;

import js.phonegap.methods.impl.MethodsPackageImpl;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;

import org.eclipse.emf.ecore.impl.EPackageImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Package</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class PhonegapPackageImpl extends EPackageImpl implements PhonegapPackage {
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass phonegapAppEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass pluginEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass accelerometerEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass cameraEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass captureEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass compassEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass connectionEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass contactsEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass deviceEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass eventsEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass fileEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass geolocationEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass mediaEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass notificationEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass storageEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass calendarEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass smsEClass = null;

	/**
	 * Creates an instance of the model <b>Package</b>, registered with
	 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
	 * package URI value.
	 * <p>Note: the correct way to create the package is via the static
	 * factory method {@link #init init()}, which also performs
	 * initialization of the package, or returns the registered package,
	 * if one already exists.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see org.eclipse.emf.ecore.EPackage.Registry
	 * @see js.phonegap.PhonegapPackage#eNS_URI
	 * @see #init()
	 * @generated
	 */
	private PhonegapPackageImpl() {
		super(eNS_URI, PhonegapFactory.eINSTANCE);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private static boolean isInited = false;

	/**
	 * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
	 * 
	 * <p>This method is used to initialize {@link PhonegapPackage#eINSTANCE} when that field is accessed.
	 * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #eNS_URI
	 * @see #createPackageContents()
	 * @see #initializePackageContents()
	 * @generated
	 */
	public static PhonegapPackage init() {
		if (isInited) return (PhonegapPackage)EPackage.Registry.INSTANCE.getEPackage(PhonegapPackage.eNS_URI);

		// Obtain or create and register package
		PhonegapPackageImpl thePhonegapPackage = (PhonegapPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof PhonegapPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new PhonegapPackageImpl());

		isInited = true;

		// Obtain or create and register interdependencies
		JsPackageImpl theJsPackage = (JsPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(JsPackage.eNS_URI) instanceof JsPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(JsPackage.eNS_URI) : JsPackage.eINSTANCE);
		BackbonePackageImpl theBackbonePackage = (BackbonePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(BackbonePackage.eNS_URI) instanceof BackbonePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(BackbonePackage.eNS_URI) : BackbonePackage.eINSTANCE);
		MethodsPackageImpl theMethodsPackage = (MethodsPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(MethodsPackage.eNS_URI) instanceof MethodsPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(MethodsPackage.eNS_URI) : MethodsPackage.eINSTANCE);

		// Create package meta-data objects
		thePhonegapPackage.createPackageContents();
		theJsPackage.createPackageContents();
		theBackbonePackage.createPackageContents();
		theMethodsPackage.createPackageContents();

		// Initialize created meta-data
		thePhonegapPackage.initializePackageContents();
		theJsPackage.initializePackageContents();
		theBackbonePackage.initializePackageContents();
		theMethodsPackage.initializePackageContents();

		// Mark meta-data to indicate it can't be changed
		thePhonegapPackage.freeze();

  
		// Update the registry and return the package
		EPackage.Registry.INSTANCE.put(PhonegapPackage.eNS_URI, thePhonegapPackage);
		return thePhonegapPackage;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getPhonegapApp() {
		return phonegapAppEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getPhonegapApp_Used() {
		return (EReference)phonegapAppEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getPlugin() {
		return pluginEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getAccelerometer() {
		return accelerometerEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getCamera() {
		return cameraEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getCapture() {
		return captureEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getCompass() {
		return compassEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getConnection() {
		return connectionEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getContacts() {
		return contactsEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getDevice() {
		return deviceEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getEvents() {
		return eventsEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getFile() {
		return fileEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getGeolocation() {
		return geolocationEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getMedia() {
		return mediaEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getNotification() {
		return notificationEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getStorage() {
		return storageEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getCalendar() {
		return calendarEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getSMS() {
		return smsEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public PhonegapFactory getPhonegapFactory() {
		return (PhonegapFactory)getEFactoryInstance();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isCreated = false;

	/**
	 * Creates the meta-model objects for the package.  This method is
	 * guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void createPackageContents() {
		if (isCreated) return;
		isCreated = true;

		// Create classes and their features
		phonegapAppEClass = createEClass(PHONEGAP_APP);
		createEReference(phonegapAppEClass, PHONEGAP_APP__USED);

		pluginEClass = createEClass(PLUGIN);

		accelerometerEClass = createEClass(ACCELEROMETER);

		cameraEClass = createEClass(CAMERA);

		captureEClass = createEClass(CAPTURE);

		compassEClass = createEClass(COMPASS);

		connectionEClass = createEClass(CONNECTION);

		contactsEClass = createEClass(CONTACTS);

		deviceEClass = createEClass(DEVICE);

		eventsEClass = createEClass(EVENTS);

		fileEClass = createEClass(FILE);

		geolocationEClass = createEClass(GEOLOCATION);

		mediaEClass = createEClass(MEDIA);

		notificationEClass = createEClass(NOTIFICATION);

		storageEClass = createEClass(STORAGE);

		calendarEClass = createEClass(CALENDAR);

		smsEClass = createEClass(SMS);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isInitialized = false;

	/**
	 * Complete the initialization of the package and its meta-model.  This
	 * method is guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void initializePackageContents() {
		if (isInitialized) return;
		isInitialized = true;

		// Initialize package
		setName(eNAME);
		setNsPrefix(eNS_PREFIX);
		setNsURI(eNS_URI);

		// Obtain other dependent packages
		MethodsPackage theMethodsPackage = (MethodsPackage)EPackage.Registry.INSTANCE.getEPackage(MethodsPackage.eNS_URI);
		JsPackage theJsPackage = (JsPackage)EPackage.Registry.INSTANCE.getEPackage(JsPackage.eNS_URI);

		// Add subpackages
		getESubpackages().add(theMethodsPackage);

		// Create type parameters

		// Set bounds for type parameters

		// Add supertypes to classes
		phonegapAppEClass.getESuperTypes().add(theJsPackage.getGlobalObject());
		accelerometerEClass.getESuperTypes().add(this.getPlugin());
		cameraEClass.getESuperTypes().add(this.getPlugin());
		captureEClass.getESuperTypes().add(this.getPlugin());
		compassEClass.getESuperTypes().add(this.getPlugin());
		connectionEClass.getESuperTypes().add(this.getPlugin());
		contactsEClass.getESuperTypes().add(this.getPlugin());
		deviceEClass.getESuperTypes().add(this.getPlugin());
		eventsEClass.getESuperTypes().add(this.getPlugin());
		fileEClass.getESuperTypes().add(this.getPlugin());
		geolocationEClass.getESuperTypes().add(this.getPlugin());
		mediaEClass.getESuperTypes().add(this.getPlugin());
		notificationEClass.getESuperTypes().add(this.getPlugin());
		storageEClass.getESuperTypes().add(this.getPlugin());
		calendarEClass.getESuperTypes().add(this.getPlugin());
		smsEClass.getESuperTypes().add(this.getPlugin());

		// Initialize classes and features; add operations and parameters
		initEClass(phonegapAppEClass, PhonegapApp.class, "PhonegapApp", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getPhonegapApp_Used(), this.getPlugin(), null, "used", null, 0, -1, PhonegapApp.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(pluginEClass, Plugin.class, "Plugin", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(accelerometerEClass, Accelerometer.class, "Accelerometer", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(cameraEClass, Camera.class, "Camera", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(captureEClass, Capture.class, "Capture", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(compassEClass, Compass.class, "Compass", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(connectionEClass, Connection.class, "Connection", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(contactsEClass, Contacts.class, "Contacts", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(deviceEClass, Device.class, "Device", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(eventsEClass, Events.class, "Events", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(fileEClass, File.class, "File", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(geolocationEClass, Geolocation.class, "Geolocation", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(mediaEClass, Media.class, "Media", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(notificationEClass, Notification.class, "Notification", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(storageEClass, Storage.class, "Storage", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(calendarEClass, Calendar.class, "Calendar", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(smsEClass, js.phonegap.SMS.class, "SMS", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
	}

} //PhonegapPackageImpl
